<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>实验图</title>
</head>
<body>
<img src="images/xiaozhu.jpg" id="img">
<script type="text/javascript">
    var k=0;
    var ss=new Array();
    ss[0] = "images/xiaozhu.jpg";
    ss[1] = "images/shangcheng.gif";
    ss[2] = "images/qiandao.gif";
    ss[3] = "images/huodong.gif";
     function scrollPic(){
         if(k>ss.length-1){
             k=0;
         }
         for(var i=0;i<ss.length;i++){
             if(i==k){
                 document.getElementById("img").src=ss[i];
             }
         }
         k++;
     }
     setInterval("scrollPic()",1000);
</script>
</body>
</html>